import Opt from '@/components/dt/info/Opt.js'
import organizationOpt from '@/biz/option/organization.js'
import ruleOpt from '@/biz/option/rule.js'

class SearchOpt extends Opt {

  constructor(name) {
    super()
    this.name = name
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      organizationOpt.create({
        key: 'orgId'
      }),
      {
        title: '奖金单年份',
        placeholder: '全部',
        key: 'bonusYear',
        visible: this.name == 'yearend',
        date: {
          type: 'year',
          disabled: (date) => {
            return date.valueOf() > new Date().getTime()
          },
        }
      },
    ]
  }
}

export default SearchOpt
